package com.phx.serialjni;
import android.graphics.Rect;

import java.util.HashMap;

public class sPageJ {
    static int pageno ;
    static int pageback ;

    static Integer[] nodeArray;

    Integer[] resArray ;
    Integer[] seqArray ;
    static Integer[] offArray ;

    static Integer[] onArray ;

    static String[] cmdArray  ;
    static String[] actArray  ;
    static  Integer[] typeArray;
    static String[] feedDArray;

    int mleft = 1204;
    int mtop = 600;
    int mwidth = 144;
    int mheight = 145;
    static int jmpPosition = 0;
    static Rect[]  allRect;


    public  static HashMap<String, String> feedMap = new HashMap<String, String>();



    public int getCountx() {
        return seqArray.length;
    }


    public static void setfeeds() {


        String[] feedDArrayx0 = new String[]{"", "", "", "", "", "", "00d1", "0002", "0072"};
        setfeedinit(feedDArrayx0);

    }

    public static void setfeedinit(String[] myDArrayx)
    {
        int vv = myDArrayx.length;
        for (int x=0; x<vv; x++) {
            if(!myDArrayx[x].equals("")) {
                feedMap.put(myDArrayx[x],"0000");
            }
        }
    }

    public void s0() {
        pageno = 0;
        pageback = R.drawable.totalui;

        //jadxgggggggui
        jmpPosition = 0;
        seqArray = new Integer[]{1, 2, 3, 4, 5, 6, 7,8};
        typeArray = new Integer[]{29, 29, 29, 24, 29, 29, 29, 28};
        //gaode chrome netease allapps weather onvideo(zhibo) localvideo   contrl

       // hdpfans.com com.hdpfans.app.ui.main.MainActivity
      //  "com.tencent.qqlive", "com.tencent.qqlive.ona.activity.SplashHomeActivity",
       // "com.estrongs.android.pop", "com.estrongs.android.pop.app.openscreenad.NewSplashActivity",
       // "com.tw.video", "com.tw.video.VideoActivity"
        cmdArray = new String[]{"com.autonavi.amapauto",
                "com.android.chrome",
                "com.netease.cloudmusic",
                "4",
                "sina.mobile.tianqitongtv",
                "hdpfans.com",
                "com.mxtech.videoplayer.pro",
                "8"};
        actArray = new String[]{"com.autonavi.auto.remote.fill.UsbFillActivity",
                "com.google.android.apps.chrome.Main",
                "com.netease.cloudmusic.activity.LoadingActivity",
                "gActivity",
                "com.weibo.tqt.ui.Splash",
                 "com.hdpfans.app.ui.main.MainActivity",
                "com.mxtech.videoplayer.pro.ActivityMediaList",
                "MainActivityf"};
        nodeArray = new Integer[]{1, 1, 1, 1, 1, 1, 1, 1};
       // nodeArray = new Integer[]{0, 0, 0, 0, 0, 0, 0, 0};
        feedDArray = new String[]{"", "", "", "", "", "", "",""};
// "com.youku.phone", "com.aligame.gamecenter.adapter.impl.GameCenterLauncherActivity"
     //   adb shell dumpsys activity|grep "youku"
       // com.huawei.hwvplayer.youku com.huawei.hwvplayer.framework.MainPageActivity
        offArray = new Integer[]{R.drawable.b1_off, R.drawable.b2_off, R.drawable.b3_off, R.drawable.b5_off,
                R.drawable.b2_on, R.drawable.b3_on,  R.drawable.b3_off, R.drawable.b5_off};

        onArray = new Integer[]{R.drawable.b1_on, R.drawable.b2_on, R.drawable.b3_on, R.drawable.b2_on,
                R.drawable.b4, R.drawable.b4_off, R.drawable.b3_on, R.drawable.b4_on};
//1024 600

        allRect = new Rect[8];
//        allRect[0] = new Rect(6, 129, 6 + 218, 129 + 178);
//        allRect[1] = new Rect(270, 129, 270 + 218, 129 + 178);
//        allRect[2] = new Rect(537, 129, 537 + 218, 129 + 178);
//        allRect[3] = new Rect(798, 129, 798 + 218, 129 + 178);
//        allRect[4] = new Rect(6, 346, 6 + 216, 346 + 176);
//        allRect[5] = new Rect(270, 346, 270 + 218, 346 + 178);
//        allRect[6] = new Rect(537, 346, 537 + 218, 346 + 178);
//        allRect[7] = new Rect(798, 346, 798 + 218, 346 + 178);

        allRect[0] = new Rect(29, 108, 29 +211, 108 + 178);
        allRect[1] = new Rect(278, 108, 278 + 211, 108 + 178);
        allRect[2] = new Rect(527 , 108, 527 + 211, 108 + 178);
        allRect[3] = new Rect(774 , 108, 774 + 211, 108 + 178);
        allRect[4] = new Rect(29, 323, 29 + 211, 323 + 178);
        allRect[5] = new Rect(278 , 323, 278 +  211, 323 + 178);
        allRect[6] = new Rect(527 , 323, 527 + 211, 323 + 178);
        allRect[7] = new Rect(774 , 323, 774 +  211, 323 + 178);

    }


    public void s1() {
        pageno = 1;
        pageback = R.drawable.a2;
        jmpPosition = 1;

        seqArray = new Integer[]{1, 2, 3, 4, 5, 6, 7,8,9};
        cmdArray = new String[]{"0","2","3","4","5",
                "D1200009",
                "C1E00009",
                "7161000E",
                "B161000E"};
        feedDArray = new String[]{"", "", "", "", "", "00b2", "00b2","00b3","01b3"};
        nodeArray = new Integer[]{1, 1, 1, 1, 1, 0, 0, 0, 0};
        typeArray = new Integer[]{20, 20, 20, 20, 20, 19, 19, 19, 19};
        offArray = new Integer[]{R.drawable.c1_off, R.drawable.c2_off, R.drawable.c3_off, R.drawable.c4_off,
                R.drawable.c1_off, R.drawable.c2_off, R.drawable.c3_off,R.drawable.c4_off, R.drawable.c1_off};

        onArray = new Integer[]{R.drawable.c1_on, R.drawable.c2_on, R.drawable.c3_on, R.drawable.c4_on,
                R.drawable.c1_on, R.drawable.c2_on, R.drawable.c3_on,R.drawable.c4_on, R.drawable.c1_on};


        allRect = new Rect[9];
        allRect[0] = new Rect(140, 1242, 140 + 190, 1242 + 160);
        allRect[1] = new Rect(765, 1242, 765 + 190, 1242 + 160);
        allRect[2] = new Rect(1080, 1242, 1080 + 190, 1242 + 160);
        allRect[3] = new Rect(1395, 1242, 1395 + 190, 1242 + 160);
        allRect[4] = new Rect(1708, 1242, 1708 + 190, 1242 + 160);
        allRect[5] = new Rect(152, 681, 152 + 139, 681 + 121);
        allRect[6] = new Rect(768, 681, 768 + 139, 681 + 121);
        allRect[7] = new Rect(1164, 681, 1164 + 139, 681 + 121);
        allRect[8] = new Rect(1780, 681, 1780 + 139, 681 + 121);
        // setfeedinit();

    }

    public void s2() {
        pageno = 2;
        pageback = R.drawable.a3;
        jmpPosition = 1;

        seqArray = new Integer[]{1, 2, 3, 4, 5, 6, 7,8,9};
        cmdArray = new String[]{"0","1","3","4","5",
                "71802003",
                "01102003",
                "02102003",
                "72502003"};
        feedDArray = new String[]{"", "", "", "","", "", "00d1", "0002","0072"};
        // feedStatus = new String[]{"", "", "", "","", "", "0001", "0002","0072"}; //仅本页有效
        nodeArray = new Integer[]{1, 1, 1, 1, 1, 1, 0, 0, 0};
        typeArray = new Integer[]{20, 20, 20, 20, 20, 19, 16, 16, 16};
        offArray = new Integer[]{R.drawable.c1_off, R.drawable.c2_off, R.drawable.c3_off, R.drawable.c4_off,
                R.drawable.c1_off, R.drawable.c2_off, R.drawable.c3_off,R.drawable.c4_off, R.drawable.c1_off};

        onArray = new Integer[]{R.drawable.c1_on, R.drawable.c2_on, R.drawable.c3_on, R.drawable.c4_on,
                R.drawable.c1_on, R.drawable.c2_on, R.drawable.c3_on,R.drawable.c4_on, R.drawable.c1_on};

        allRect = new Rect[9];
        allRect[0] = new Rect(140, 1242, 140 + 190, 1242 + 160);
        allRect[1] = new Rect(451, 1242, 451 + 190, 1242 + 160);
        allRect[2] = new Rect(1080, 1242, 1080 + 190, 1242 + 160);
        allRect[3] = new Rect(1395, 1242, 1395 + 190, 1242 + 160);
        allRect[4] = new Rect(1708, 1242, 1708 + 190, 1242 + 160);
        allRect[5] = new Rect(269, 543, 269 + 185, 543 + 399);
        allRect[6] = new Rect(774, 608, 774 + 141, 608 + 139);
        allRect[7] = new Rect(1204, 600, 1204 + 144, 600 + 145);
        allRect[8] = new Rect(1651, 447, 1651 + 185, 447 + 339);

        //反馈状态初始化显示
        //根绝接收的反馈信息变换状态


        // setfeedinit();
    }


    public void setInit(int currentPage) {

        switch (currentPage) {
            case 0:
                s0();
                break;
            case 1:
                s1();
                break;
            case  2:
                s2();
                break;
            default:
                break;
        }
    }



}

